<?php
/*
 * @author : Pham Huu Sam
 * @phone : 0922.926.269
 */
class Users extends CI_Controller{
    //put your code here

    public function  __construct() {
        parent::__construct();
        $this->load->helper("url");
        $this->load->library("admin_layout"); // Sử dụng thư viện layout
        $this->admin_layout->setLayout("layout/admin"); // load file layout chính (view/layout/frontend.php)
        $this->load->Model('Musers');
    }

    // Controller mặc định cho trang chủ
    public function index(){
        $data['title'] = 'Users';
        $data['data'] = $this->Musers->listAllUserNomal();
        $this->admin_layout->view("admin/users", $data);
    }
    public function listAllUserBanNick(){
        $data['title'] = 'Users';
        $data['data'] = $this->Musers->listAllUserBanNick();
        $this->admin_layout->view("admin/usersbannick", $data);
    }
    public function listAllUserAdmin(){
        $data['title'] = 'Users';
        $data['data'] = $this->Musers->listAllUserAdmin();
        $this->admin_layout->view("admin/usersadmin", $data);
    }
    public function deleteUser($id){
        $this->Musers->deleteUser($id);
        redirect('admin/users');
    }
}
?>
